#include"Seqstack.h"
#include<string>
#include<iostream>
using namespace std;
class PHONEBOOK
{
	private:
		int m_ID;
		string m_name;
		string m_phone;
		string m_group;
	public:
		PHONEBOOK()
		{

		}
		PHONEBOOK(int id,string name,string phnoe,string group)
		{
			m_ID=id;
			m_name=name;
			m_phone=phnoe;
			m_group=group;
		}
		void print()
		{
			cout<<m_ID<<'\t'<<m_name<<'\t'<<m_phone<<'\t'<<m_group<<endl;
		}
		bool operator == (PHONEBOOK &p)
		{
			if(p.m_ID==m_ID)
				return true;
			return false;
		}
};
int main()
{
    PHONEBOOK pbook[4]={{20181208,"mary","1301112","classmates"},
	{20181127,"tom","1392346","family"},
	{20181156,"john","1323456","classmates"},
	{20171124,"lisa","1384456","classmates"}};
	PHONEBOOK record(20181209,"pjouh","1243654","classmates");
    Seqstack<PHONEBOOK> pstack;
    for (int i = 0; i < 4; i++)
    {
        pstack.Push(pbook[i]);
    }
    for (int i = 0; i < 4; i++)
    {
        PHONEBOOK x=pstack.Pop();
        x.print();
    }
}